/**
 * @file src/Functions/enumeratePairing.cpp
 *
 * @section DESCRIPTION
 * Stores the enumeratePairing function.
 *
 * @date 31-mar-2013
 *
 * @author Youri Hoogstrate
 *
 * @section LICENSE
 * yh-kt-fold can predict RNA 2D structures including K-turns.
 * Copyright (C) 2012-2013 Youri Hoogstrate
 *
 * This file is part of yh-kt-fold.
 *
 * yh-kt-fold is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * yh-kt-fold is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */



#include "main.h"
#include "Functions/library.h"



using namespace std;



/**
 * @brief Enumerates a set of two nucleotides.
 * @attention These returned integers are used by sint2, asint3, sint4
 *
 * @date 12-mar-2013
 *
 * @param i Nucleotide position of the sequence, paired to j, where i < j
 * @param j Nucleotide position of the sequence, paired to i, where i < j
 *
 * @return Mapped int for nucleotide pairs; AU: 0, CG: 1, GC: 2, UA: 3, GU: 4 & UG: 5
 *
 * @todo change int into signed char
 */
int enumeratePairing(char i, char j)
{
	if(i == 'A' && j == 'U')
	{
		return PAIRING_AU;
	}
	else if(i == 'C' && j == 'G')
	{
		return PAIRING_CG;
	}
	else if(i == 'G' && j == 'C')
	{
		return PAIRING_GC;
	}
	else if(i == 'U' && j == 'A')
	{
		return PAIRING_UA;
	}
	else if(i == 'G' && j == 'U')
	{
		return PAIRING_GU;
	}
	else if(i == 'U' && j == 'G')
	{
		return PAIRING_UG;
	}
	else
	{
		return PAIRING_NONE;
	}
}
